﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using SampleKeyValueDemo.Relationships;
using SampleKeyValueDemo.DataLayer;

namespace SampleKeyValueDemo
{
    public class DataStoreFactory : IErrorHandler
    {

        public static IKeyValueDataStore<DataItemDog> GDogStore(){

            var db = new ErrorSquelch<DataItemDog>(new DogSource(), new DataStoreFactory()); 
            var files = new SolidStateStore<DataItemDog>();
            var backup = new BackupRelationship<DataItemDog>(db, files);

            var cache = new AppCacheStore<DataItemDog>();
            var relationship = new CacheRelationship<DataItemDog>(cache, backup);

            return relationship;

            //db = new ErrorSquelch<DataItemDog>(new DogSource(), new DataStoreFactory());
            //var disk = new SolidStateStore<DataItemDog>();
            //var backup = new BackupRelationship<DataItemDog>(
            //    db, disk);
            //var cache = new AppCacheStore<DataItemDog>();
            //var relationship = new CacheRelationship<DataItemDog>(
            //    cache, backup);
            //return relationship;
        }




        public void HandleError(Exception ex)
        {

        }
    }
}